class HotlineCallsController < ApplicationController
  # GET /hotline_calls
  # GET /hotline_calls.xml
  def index
    @hotline_calls = HotlineCall.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @hotline_calls.to_xml }
    end
  end

  # GET /hotline_calls/1
  # GET /hotline_calls/1.xml
  def show
    @hotline_call = HotlineCall.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @hotline_call.to_xml }
    end
  end

  # GET /hotline_calls/new
  def new
    @hotline_call = HotlineCall.new
  end

  # GET /hotline_calls/1;edit
  def edit
    @hotline_call = HotlineCall.find(params[:id])
  end

  # POST /hotline_calls
  # POST /hotline_calls.xml
  def create
    @hotline_call = HotlineCall.new(params[:hotline_call])

    respond_to do |format|
      if @hotline_call.save
        flash[:notice] = 'HotlineCall was successfully created.'
        format.html { redirect_to hotline_call_url(@hotline_call) }
        format.xml  { head :created, :location => hotline_call_url(@hotline_call) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @hotline_call.errors.to_xml }
      end
    end
  end

  # PUT /hotline_calls/1
  # PUT /hotline_calls/1.xml
  def update
    @hotline_call = HotlineCall.find(params[:id])

    respond_to do |format|
      if @hotline_call.update_attributes(params[:hotline_call])
        flash[:notice] = 'HotlineCall was successfully updated.'
        format.html { redirect_to hotline_call_url(@hotline_call) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @hotline_call.errors.to_xml }
      end
    end
  end

  # DELETE /hotline_calls/1
  # DELETE /hotline_calls/1.xml
  def destroy
    @hotline_call = HotlineCall.find(params[:id])
    @hotline_call.destroy

    respond_to do |format|
      format.html { redirect_to hotline_calls_url }
      format.xml  { head :ok }
    end
  end
end
